﻿using CinemaMaestro.DataLayer.Contracts.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CinemaMaestro.ViewModels
{
    public class LanguageViewModel
    {
        public int Id { get; set; }
        public string Name { get; set; }

        public static implicit operator LanguageViewModel(Language language)
        {
            return new LanguageViewModel
            {
                Id = language.Id,
                Name = language.Name
            };
        }

        public static implicit operator Language(LanguageViewModel languageVM)
        {
            return new Language
            {
                Id = languageVM.Id,
                Name = languageVM.Name
            };
        }

        public override string ToString()
        {
            return Name;
        }
    }
}
